package com.nutricia.common.api.result;


import com.nutricia.common.lang.BaseResponse;

import java.io.Serializable;
import java.util.List;

/**
 * 统一分页对象
 *
 * @author: huangsheng
 * @date: 2017/10/19 下午5:01
 */
public class PageBaseResult<T> extends BaseResponse implements Serializable {

    /**
     * 实例化常量
     */
    private static final long serialVersionUID = 1882965792578587198L;

    /**
     * 每页显示多少条
     */
    private int pageSize = 10;

    /**
     * 当前页数
     */
    private int currentPage = 1;

    /**
     * 数据总数
     */
    private int recordsTotal;

    /**
     * table数据
     */
    private List<T> data;

    /**
     *
     * @param pageSize
     * @param currentPage
     */
    public PageBaseResult(int pageSize, int currentPage) {
        this.pageSize = pageSize;
        this.currentPage = currentPage;
    }

    /**
     * Gets serial version uid.
     *
     * @return the serial version uid
     */
    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    /**
     * Gets page size.
     *
     * @return the page size
     */
    public int getPageSize() {
        return pageSize;
    }

    /**
     * Sets page size.
     *
     * @param pageSize the page size
     */
    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    /**
     * Gets current page.
     *
     * @return the current page
     */
    public int getCurrentPage() {
        return currentPage;
    }

    /**
     * Sets current page.
     *
     * @param currentPage the current page
     */
    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    /**
     * Gets records total.
     *
     * @return the records total
     */
    public int getRecordsTotal() {
        return recordsTotal;
    }

    /**
     * Sets records total.
     *
     * @param recordsTotal the records total
     */
    public void setRecordsTotal(int recordsTotal) {
        this.recordsTotal = recordsTotal;
    }

    /**
     * Gets data.
     *
     * @return the data
     */
    public List<T> getData() {
        return data;
    }

    /**
     * Sets data.
     *
     * @param data the data
     */
    public void setData(List<T> data) {
        this.data = data;
    }
}
